package com.richie696.account.model;

import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Objects;

public class AccountRequestModel implements Serializable {

    private String fromCardNo;

    private String toCardNo;

    private Double money;

    public String getFromCardNo() {
        return fromCardNo;
    }

    public void setFromCardNo(String fromCardNo) {
        this.fromCardNo = fromCardNo;
    }

    public String getToCardNo() {
        return toCardNo;
    }

    public void setToCardNo(String toCardNo) {
        this.toCardNo = toCardNo;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public boolean isInvalid() {
        return StringUtils.isBlank(fromCardNo) ||
                StringUtils.isBlank(toCardNo) ||
                (Objects.nonNull(money) && money < 0.0D);
    }
}
